<?
$sub_menu = "300300";
include_once("./_common.php");

if($Mode == "INSERT")
{
	$pop_code = "POP".time();
	$pop_content = addslashes($pop_content);

	$QUERY = "insert into $g4[popup_table] (";
	$QUERY.= "pop_code,pop_title,pop_top,pop_left,pop_width,pop_height,pop_use,pop_content,pop_regday";
	$QUERY.= ") values (";
	$QUERY.= "'$pop_code','$pop_title','$pop_top','$pop_left','$pop_width','$pop_height','$pop_use','$pop_content',now()";
	$QUERY.= ")";
	mysql_query($QUERY);
}
elseif($Mode == "UPDATE")
{
	$pop_content = addslashes($pop_content);

	$QUERY = "update $g4[popup_table] set ";
	$QUERY.= "pop_title		='$pop_title', ";
	$QUERY.= "pop_top		='$pop_top', ";
	$QUERY.= "pop_left		='$pop_left', ";
	$QUERY.= "pop_width		='$pop_width', ";
	$QUERY.= "pop_height	='$pop_height', ";
	$QUERY.= "pop_use		='$pop_use', ";
	$QUERY.= "pop_content	='$pop_content' ";
	$QUERY.= "where idx = '$IDX' limit 1";
	mysql_query($QUERY);
}
elseif($Mode == "DELETE")
{
	$QUERY = "delete from $g4[popup_table] where idx = '$IDX' limit 1";
	mysql_query($QUERY);
}
else
{
}
goto_url("./popup_list.php");
?>